package io.e2x.testground.fruitstore.dal.entities;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.Transient;
import org.springframework.data.relational.core.mapping.Table;

import java.math.BigDecimal;
import java.util.List;
/**
 * 订单
 * @author: sukimiya
 * @date: 2020/5/27 16:01
 */
@Table("TRADE_ORDER")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class TradeOrder {
    @Id
    private long id;

    /**
     * 订单编号
     */
    private String no;

    /**
     * 用户ID
     */
    private long userId;
    /**
     * 店铺ID
     */
    private long storeId;

    /**
     * 优惠价格
     */
    private BigDecimal couponPrice;
    /**
     * 减免价格
     */
    private BigDecimal discountPrice;
    /**
     * 实际支付价格
     */
    private BigDecimal payPrice;
    /**
     * 订单价格
     */
    private BigDecimal price;
    /**
     * 订单项
     */
    @Transient
    private List<TradeOrderItem> items;

    private Integer couponType;

    private BigDecimal couponValue;

    private BigDecimal couponLimit;
}
